UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RO6TBDL3bSsd1uV/57NCOsoTw4dZEe3hlitV2QfVnQ=' 
WHERE 
  key_id = '269c6c3161c754dc963551d9195885e5c3234b2ca0a29224fb43792d598e5b8e' 
  AND (
    token = '0RO6TBDL3bSsd1uV/57NCOsoTw4dZEe3hlitV2QfVnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029