UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFwLG3O+PrVTDNqEdNiTr+y/7JKT3WY/h2xHKni8IbA=' 
WHERE 
  key_id = 'b64afa7737f07e50afee43abd4fc74f4993ca5be6a36cf40a86204c288757e4d' 
  AND (
    token = 'VFwLG3O+PrVTDNqEdNiTr+y/7JKT3WY/h2xHKni8IbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046