UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BvGzzqFAEwu2aBrfsPI2pRHY+ltuzRMQdgPHOqhXF/M=' 
WHERE 
  key_id = '71fef8e18d1dd95f8dc4e5e76fdc49756b670b273864b122be8d3ddd152a8ff1' 
  AND (
    token = 'BvGzzqFAEwu2aBrfsPI2pRHY+ltuzRMQdgPHOqhXF/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040