UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPfYSHcIWNUrEtCPbHaP0vF2ggWzeMNEahO2UYWSwIc='
WHERE
key_id = '9c9b1c4a5dfe3308f22ff0ab13a68de7e1dcc7be8df86955db3f79715a886c38'
AND (
token = 'mPfYSHcIWNUrEtCPbHaP0vF2ggWzeMNEahO2UYWSwIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)