UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3lqOpoShPpbBRzKO7Zj7qfApcSYxboe3k83Nnr6HSTk=' 
WHERE 
  key_id = '3ff58046f6dc8fc857a60552e0f2abb808e7cd2fe204c4b6c62f393bb5a09c31' 
  AND (
    token = '3lqOpoShPpbBRzKO7Zj7qfApcSYxboe3k83Nnr6HSTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024