UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AEZUpxC3WiJ2XKKIDk3IlRAU6crBs2HRbixbCDwF25I=' 
WHERE 
  key_id = '19860b2741a6a62388d30255e243774e0846f55f2bb64c2e56e3163ccc16c935' 
  AND (
    token = 'AEZUpxC3WiJ2XKKIDk3IlRAU6crBs2HRbixbCDwF25I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019