UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yoUIX6Gk5H7/HbIblKcNYpc8yluuPtClqhbECGYQ3G0='
WHERE
key_id = '0d564c38781cb8052c536c4b73e0bb6ba9d2b276772b028d3acd5938bc9dd91c'
AND (
token = 'yoUIX6Gk5H7/HbIblKcNYpc8yluuPtClqhbECGYQ3G0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)