UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VfTXLeaogBmdSVxPsY2IWC6tK/7XO/Gw7sLApfGWiNs=' 
WHERE 
  key_id = 'a0013fadf5f296821bb220242f47f8b0618d4b3ca1dd5f1fb4a3494fd7697f18' 
  AND (
    token = 'VfTXLeaogBmdSVxPsY2IWC6tK/7XO/Gw7sLApfGWiNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045