UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hRecrHPPCV+nHN6vKA+XcJTVEsw5WKhWi7vNtUIPwYA='
WHERE
key_id = '6fcef5599db43f8e4540c051f519cdd79244f11f71e3caa09fb4cb58ccb19090'
AND (
token = 'hRecrHPPCV+nHN6vKA+XcJTVEsw5WKhWi7vNtUIPwYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)