UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JoaJwCqzinyNixQFUW533sgXCNrrnKMUn8wBR1su6WU=' 
WHERE 
  key_id = '86ec45cd85bef9621bfed1c68dc9cb99271e157acaaf04ef1cbc14ec6358ee53' 
  AND (
    token = 'JoaJwCqzinyNixQFUW533sgXCNrrnKMUn8wBR1su6WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040