UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jauFB/ozgKU1Bagf8RVOKW5Wj4I8iPby4ZEuJXPynYY='
WHERE
key_id = '8dd9e6a6cadd9936296a0ee24d2e67a59acf1bc58a933a1c36def00d06db5b73'
AND (
token = 'jauFB/ozgKU1Bagf8RVOKW5Wj4I8iPby4ZEuJXPynYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)