UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Wjy/YgLxdxsUp2b7JZDZ4d1f/XW3AdPutwa9u9PaPk='
WHERE
key_id = 'b0620ea9414cd67b75ea46466b6fed1755db75a58e7509be3813a0d5b98437d6'
AND (
token = '4Wjy/YgLxdxsUp2b7JZDZ4d1f/XW3AdPutwa9u9PaPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)