UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cf/SMGccGlyPgbCZeVjqtwNRJB/vPdMmHhKTi9e/cX4='
WHERE
key_id = '331589abe45310d76b38d704b0965f4fe7b627d625c134b09378753ba9773bf8'
AND (
token = 'cf/SMGccGlyPgbCZeVjqtwNRJB/vPdMmHhKTi9e/cX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)