UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bdFhbeSMeR4LlXPn9WhtR/aS560MTeYSyw/70+X24UM='
WHERE
key_id = '70d2d8c6c0b0e826aa0f08a6e81a329bfdfd4258dfbc221176126dbed1c9cb0d'
AND (
token = 'bdFhbeSMeR4LlXPn9WhtR/aS560MTeYSyw/70+X24UM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)