UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AhPvCNUOQqhMJHXcAdBC22Bofnut/Ex0Lf/0RS13Uyo='
WHERE
key_id = 'af91f72f5c9a75b8828e07c2b165bc27acb3396b21832ab1fcf81d16f31273f3'
AND (
token = 'AhPvCNUOQqhMJHXcAdBC22Bofnut/Ex0Lf/0RS13Uyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)