UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gPsJYjuGsJ1LxSYtKubfjwgOym4+1Q4cdURVqFiyQhM=' 
WHERE 
  key_id = '0c0c2ade53f84d5f50fc452b0322250a0d041b37f341b2b36a8cb432904b61e6' 
  AND (
    token = 'gPsJYjuGsJ1LxSYtKubfjwgOym4+1Q4cdURVqFiyQhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030