UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kDXLG03NBLxvo8ho2DkeIqZPu58dbMOz0I5VjIHr0U='
WHERE
key_id = '4e5fc9947f70ddf796904241d34c2144e9d66ad333d0061ab49db618144f65a9'
AND (
token = '1kDXLG03NBLxvo8ho2DkeIqZPu58dbMOz0I5VjIHr0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)