UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yhTU0ZljEgbojQa/M9VigqGCNuBZVRY+JeYjaE19ZvY='
WHERE
key_id = '3a74b8e8036793a9c949bc4561d334739d4ce472452220bbf6f374c7acffeeb7'
AND (
token = 'yhTU0ZljEgbojQa/M9VigqGCNuBZVRY+JeYjaE19ZvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)