UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'siswYOkjhgnlA4til4A7pvETF0WjF/58/nTBGL7HVqo='
WHERE
key_id = 'fc778090a2d692354dfdf0733380baa620db6566dac0e0cad9236dc12d7a39fb'
AND (
token = 'siswYOkjhgnlA4til4A7pvETF0WjF/58/nTBGL7HVqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)