UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J7FGQad80EvUE9WW1lJXNUnBGhnORn1k0xAaMKzcyTw=' 
WHERE 
  key_id = 'df6eb353c7aa415efe8f3b42910c0f8e254d1a201b9c448b69b1a3c6e7d6532a' 
  AND (
    token = 'J7FGQad80EvUE9WW1lJXNUnBGhnORn1k0xAaMKzcyTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033