UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+qU8osvbtEvzZuYXCDchlYl48Kc6GPbfui6Myc0z+SM='
WHERE
key_id = '6aa2274955ba736cb896e110f863cc40f33d095378f7cf6d570fdeb9487adf5e'
AND (
token = '+qU8osvbtEvzZuYXCDchlYl48Kc6GPbfui6Myc0z+SM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)