UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HtwMPypuFIkxSRSPLs66SCV32RyM2pagneSO2xuVSjI='
WHERE
key_id = 'a2c01bce1573d813914f93ab96d8a226de844aa5e634ade85810da21b980da75'
AND (
token = 'HtwMPypuFIkxSRSPLs66SCV32RyM2pagneSO2xuVSjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)