UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dQnCis24j+/ypTEkA00GHt50gCdNMXjIHPoN++hrQq0='
WHERE
key_id = '9428db1befff7970f3a784d4e6b3c18477c4297068be027cc2094424a9114c45'
AND (
token = 'dQnCis24j+/ypTEkA00GHt50gCdNMXjIHPoN++hrQq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)