UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6/mPY/aBjo8aij61EbEMd7kFo+ETiVV/4SER1+QtsnQ='
WHERE
key_id = '113e49ccef0e376a9f4e41f2aa4d4901abaa621d1487a2191cbdf3817e828a5a'
AND (
token = '6/mPY/aBjo8aij61EbEMd7kFo+ETiVV/4SER1+QtsnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)