UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JzphUIMZ7UzkJg803Pq4csYiTCun42Aafjagpjn6Sg='
WHERE
key_id = '16697d69980b58c45cb4f78bc8df121c4b960ea7a0a93510cd60671b286b9d53'
AND (
token = '6JzphUIMZ7UzkJg803Pq4csYiTCun42Aafjagpjn6Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)