UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O4HlvotwTKPiN7aVnKncdcUOpzzDcJEWSzlktQbcjwE=' 
WHERE 
  key_id = '5c0e81e870e9fe365ad156718ddc80f2b678afab73850d484e8f1d3d582cc21e' 
  AND (
    token = 'O4HlvotwTKPiN7aVnKncdcUOpzzDcJEWSzlktQbcjwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036