UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1PMIYJrcokJPel4VmloXJl961X1i4M/Hndu1fOdvpqU=' 
WHERE 
  key_id = '3f1ef1fdbcfe5950df56fe6152cbb3f9cc43ecf6f2db6b0f258943e3206dab05' 
  AND (
    token = '1PMIYJrcokJPel4VmloXJl961X1i4M/Hndu1fOdvpqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033