UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPkkG0IlPSwcAJLgcnjQasQo6P355ux4t/nneggEK6k=' 
WHERE 
  key_id = 'd2442f39c9b14dc318f5479ae6017e172bb604a8fef6ed3d1e858a200eec6cd9' 
  AND (
    token = 'HPkkG0IlPSwcAJLgcnjQasQo6P355ux4t/nneggEK6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032