UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RbfgUoW2ud1OUdv6UexXh/M7qGjU5DvgKjzBKc9LJug=' 
WHERE 
  key_id = 'faf925ef10030df2b9b288106582bb67de673abd94b3aef931529d4076290343' 
  AND (
    token = 'RbfgUoW2ud1OUdv6UexXh/M7qGjU5DvgKjzBKc9LJug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024