UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9RbzFKMhCIJCWKe9vEEZN4z0ROvXpFXd2wIuE3iR+NQ=' 
WHERE 
  key_id = 'ab632de3d3e39d6322eb6bac94ff19ac889816e230a6bcca08b5d16174cbf0b6' 
  AND (
    token = '9RbzFKMhCIJCWKe9vEEZN4z0ROvXpFXd2wIuE3iR+NQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036