UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tfxm104WKdV85bHLQplkywiO79Y7qKeBV+OqgVstIO8=' 
WHERE 
  key_id = '0fb5b52ef0f33f58846649efdcb054b9f31232dbfb435c2ea1e6ce8ef5f467dc' 
  AND (
    token = 'Tfxm104WKdV85bHLQplkywiO79Y7qKeBV+OqgVstIO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033