UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KR8Yg/8TS4wiy3cgpkkS8Jg52fIHidO/+aKQ5yFw4c0='
WHERE
key_id = '0b475b677696e3b75afba20a1632fa6430cfb987238cc8232ec25487e9c784dc'
AND (
token = 'KR8Yg/8TS4wiy3cgpkkS8Jg52fIHidO/+aKQ5yFw4c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)