UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iW9s14VEcWxwcRyn/kskdrtsGcTCd2IFJCR7YaOTG6c='
WHERE
key_id = '5aa677ed0f676b1b6ab1c65d29ec9f4e76d491ed5ca7b46bc7eab6db1f5f5720'
AND (
token = 'iW9s14VEcWxwcRyn/kskdrtsGcTCd2IFJCR7YaOTG6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)