UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eqGeIKs3lnWNjVXbcKLo8Z99G4fN5JxrKVt16wgbjQI=' 
WHERE 
  key_id = 'c842eed1d9a95902cec8f73356acc0031bf06594125f180e09473427fa79e731' 
  AND (
    token = 'eqGeIKs3lnWNjVXbcKLo8Z99G4fN5JxrKVt16wgbjQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040