UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vr5sZn3jmZUdue9dAhY+trDdGy+V2KknO/MKJrDVUOY=' 
WHERE 
  key_id = 'b03978ad03867735c92101787a25a04ba5737fe6a23b48f6fff2559affb5f9ef' 
  AND (
    token = 'vr5sZn3jmZUdue9dAhY+trDdGy+V2KknO/MKJrDVUOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021