UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HJ/UgelOWezTHIf2L0/K5K5hw6D5GeMBIaqV98VaO+A='
WHERE
key_id = 'c2f3a884052e9624a646941bf5f5256898df4f93a1516c6fbf264be093d9af18'
AND (
token = 'HJ/UgelOWezTHIf2L0/K5K5hw6D5GeMBIaqV98VaO+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)