UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MClht4I4v8h4mq0oGARAzVytuetEWCSoIaCo8O6sv2g='
WHERE
key_id = '5391ba113c9eb996a2a612b316a1ed6e911101208c963ec51a607c883d2ffb62'
AND (
token = 'MClht4I4v8h4mq0oGARAzVytuetEWCSoIaCo8O6sv2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)