UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V2zJieR6O2H+gpGIoDuHf3078L+/uO4xSP+n2HaPNqA='
WHERE
key_id = '11c9bf8750e8fc64c1d061c9609213a2415b81d6687b562e2e388ad5da0fa9a0'
AND (
token = 'V2zJieR6O2H+gpGIoDuHf3078L+/uO4xSP+n2HaPNqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)