UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rG/cxc/fb9IYQC/F4FUqYNmTu7dZ91P093sqWst56tA='
WHERE
key_id = 'ced3702ef1e56fe6fba3c4870d4f515a3d7f887f5436071ea0cbeb7f15a24cff'
AND (
token = 'rG/cxc/fb9IYQC/F4FUqYNmTu7dZ91P093sqWst56tA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)