UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'di1dwuqLXY+Vmh2J4qYkXxiSbsi09DCIIFGY0iC3zNs='
WHERE
key_id = 'd325b53385eac3be48d655f07914eff017f070d425d422baea5c64e31b8507b8'
AND (
token = 'di1dwuqLXY+Vmh2J4qYkXxiSbsi09DCIIFGY0iC3zNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)