UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uXG4G9wmaonzPvYXbjzYEAgd77+JV39mJQXb9SGwcOU='
WHERE
key_id = 'eb870229f5d6edfbef6ac50b451f721db15cd15d8126f09e097f82fad9b3b4e7'
AND (
token = 'uXG4G9wmaonzPvYXbjzYEAgd77+JV39mJQXb9SGwcOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)