UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32kqJApQP3sXV4zAuz852rBjH0gbFsfXD/1WBGWLDAU='
WHERE
key_id = '16a38fff29f8b10633bcedd7eda05a27213748207ad9e9807d16f069a12799da'
AND (
token = '32kqJApQP3sXV4zAuz852rBjH0gbFsfXD/1WBGWLDAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)