UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sCfp6/ZbViFl0N7DvWrlbFgWxYS1xzrRwYB5a6A1B8k='
WHERE
key_id = '1fb7c6eae99d067022da3e8f38defd1f5b6dce9b6ef1766607b5e99ef05faf43'
AND (
token = 'sCfp6/ZbViFl0N7DvWrlbFgWxYS1xzrRwYB5a6A1B8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)