UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'scYL2swB8cI8M7TEXeZhEfet7b2hkSFFvBF0MhmzBKw='
WHERE
key_id = '86fda93a4ca2e0206e9f13ce3146da0e920fe4ad688d52418b97bf9b8ddfd1aa'
AND (
token = 'scYL2swB8cI8M7TEXeZhEfet7b2hkSFFvBF0MhmzBKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)