UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LOmciTqMwe844K6rAXkBHj8Yz7ZA1ZnJHvCG+lrLZ2Q='
WHERE
key_id = '7cb561b5086ecfd74eda1f7d44a8d458609c14232e757bbd761670ad69c05557'
AND (
token = 'LOmciTqMwe844K6rAXkBHj8Yz7ZA1ZnJHvCG+lrLZ2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)