UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wnCb5pOtLyqlZKHbdGHdcb8tKDeowTgr58lPTz6JtA='
WHERE
key_id = '484a5106aa37de5f2b889ae48171b76c876cf07b91fc6fd0b47682a4413e7492'
AND (
token = '7wnCb5pOtLyqlZKHbdGHdcb8tKDeowTgr58lPTz6JtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)