UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1BCzoGNwbtiuUYGV6ZjfOcaCblIYgv4QFJJKAcv13cs='
WHERE
key_id = '9c280a222524a4f9e4d63306009eede26c584f39e4bf6dea7c2b688276addc45'
AND (
token = '1BCzoGNwbtiuUYGV6ZjfOcaCblIYgv4QFJJKAcv13cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)