UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GHROMHbk7GdeesN1Pk0Q+mt59aDzXkMARa+DS8t/X3s=' 
WHERE 
  key_id = '675a17130a1f2e2329e38199513ba3cc5d776841511d34df6a17b78c738584e2' 
  AND (
    token = 'GHROMHbk7GdeesN1Pk0Q+mt59aDzXkMARa+DS8t/X3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020