UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xaKHBNQF/e7aIh83FUW4LlncaBtIOOpetVYbwwaIbAk='
WHERE
key_id = '361c256a6127146f8ee3445547804f5821598d494ba68176847b52d3623c8a20'
AND (
token = 'xaKHBNQF/e7aIh83FUW4LlncaBtIOOpetVYbwwaIbAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)