UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'poJOHy8iNLzaSBeHqvBqpRzn29T3LU1qK4MEaiTxbEw='
WHERE
key_id = '2ff0bd31716f8be38160addea5b203b100a8a00e2bf8c6b0b2d600a8ccbe8d19'
AND (
token = 'poJOHy8iNLzaSBeHqvBqpRzn29T3LU1qK4MEaiTxbEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)