UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SPv5jeykCcJvo1hJClhY4mMF0kDkd9U+muwlp6bibr0='
WHERE
key_id = '6b88275397439e552a274f454157c691d7a65722a2de8fa25806b867f0f41e1a'
AND (
token = 'SPv5jeykCcJvo1hJClhY4mMF0kDkd9U+muwlp6bibr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)