UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uzNVn0aBHxpdJlPh2rg1/zMAcVMgULsMlmu0KCndmxg=' 
WHERE 
  key_id = '48d53d85525c1db3d1438f959a0262181fac6ee6bfa8c837c731c511f1232480' 
  AND (
    token = 'uzNVn0aBHxpdJlPh2rg1/zMAcVMgULsMlmu0KCndmxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028