UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bBd4Gw9tdVOWGO8UWC1R6gtoHiqzmFiZxMVlMu677XQ='
WHERE
key_id = '464dd3ff19899a8d7e892ec9e17dd7fc469e578bff85512e4e81e7affbd96d77'
AND (
token = 'bBd4Gw9tdVOWGO8UWC1R6gtoHiqzmFiZxMVlMu677XQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)