UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYqLRt8bwZZK2a29NV2//VviaU4Lmp8lgSKnGqCg9Xg='
WHERE
key_id = 'a14dee87b2216ab5be00adcdb52731a11e5db1d66c618cdb47c929d495ca685c'
AND (
token = 'oYqLRt8bwZZK2a29NV2//VviaU4Lmp8lgSKnGqCg9Xg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)