UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ud/44pN+SfqCq0BpIfdRuIEXCMpKbIqP/rCgSEVSI7o='
WHERE
key_id = 'cc9065b17b134feef5cdc818c3c58508dd6d1db1cceac66ccc6b06f086b7566e'
AND (
token = 'Ud/44pN+SfqCq0BpIfdRuIEXCMpKbIqP/rCgSEVSI7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)