UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wm+JsyimBzgjYwku7UenoxLWyjfmc3bZUt0i4LqS+DE='
WHERE
key_id = '8e4e61299b05b553a1ef8d4cd90865b86ca2d8cccf5f00a60a246f23751a6e02'
AND (
token = 'wm+JsyimBzgjYwku7UenoxLWyjfmc3bZUt0i4LqS+DE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)