UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6vBQ+RQravboW1xZ1YGDt9la0iCpWvxdUKA87Itphng='
WHERE
key_id = '3b32fbc472ab89f4bc76a0d72f9353981847d16fe381b414584e3cdf43e96480'
AND (
token = '6vBQ+RQravboW1xZ1YGDt9la0iCpWvxdUKA87Itphng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)