UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KSUL5U1PmVEpTxPFkcXv+aDmsZcCJCjHLZHzww3GQA='
WHERE
key_id = '290803367a71bbe48ed4dc9ec449af03cbb49d79f4e81a34a4b742d1d791f336'
AND (
token = '4KSUL5U1PmVEpTxPFkcXv+aDmsZcCJCjHLZHzww3GQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)