UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/eNnIW1lRdIQd3g9SD9VHXHRbfPUcA1X9Um2fgGTzc=' 
WHERE 
  key_id = '1bac4fd19fadd78c565148549bb0190de0344ab860fc185b2bb0cd04075f1a8b' 
  AND (
    token = 'L/eNnIW1lRdIQd3g9SD9VHXHRbfPUcA1X9Um2fgGTzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035