UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ApzZgvT/ASMkuruxmQ5CLr/d1Ct59YeeA+x2lExMszw='
WHERE
key_id = '114f248e52407dd66421092fe85271e40c0644c0e5a8e27c0bf891b23e9fba00'
AND (
token = 'ApzZgvT/ASMkuruxmQ5CLr/d1Ct59YeeA+x2lExMszw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)