UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n38F/fcqX4CXu7nKl0RhycCyTRJTStoS+Neu5dsN8Ko=' 
WHERE 
  key_id = '5e116b7e08301c7a54fe72c7ca47f7247895f929b2323a6c8dfe693b4afd4f5e' 
  AND (
    token = 'n38F/fcqX4CXu7nKl0RhycCyTRJTStoS+Neu5dsN8Ko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031