UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HUUEYOgzaDbASpnJOrBL5RkG+uMR9dqdVQalbkMhV0g='
WHERE
key_id = '5bdde4b1a90d5403382de531abfb060e5f11d0fe1a73f48e63d20adfb3eeb284'
AND (
token = 'HUUEYOgzaDbASpnJOrBL5RkG+uMR9dqdVQalbkMhV0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)