UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GehqOeEdg3f+/dC0q23Nj+vBgBzdFYlUmA1oPgxV8j0='
WHERE
key_id = '6ce87f0f85190316ae8e9177f2bcbbebba4434675fd97da2dc5830f0ee014d4a'
AND (
token = 'GehqOeEdg3f+/dC0q23Nj+vBgBzdFYlUmA1oPgxV8j0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)