UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H9WC4IlTYtHi1LhTt5dumZcJjGNx96NCiKyQFXmqgRE='
WHERE
key_id = 'da39547b406213125d229accf8f15c9e9470bfcf4601b62fd52dec5f37b17dd0'
AND (
token = 'H9WC4IlTYtHi1LhTt5dumZcJjGNx96NCiKyQFXmqgRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)