UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F7fyLm2rUOwXyi+2AR5l/6BT120sU47QOc1pfQNDvI8='
WHERE
key_id = '86906d0c1165f4b955865ab98ecfef3dbf33c90f985e1e8831a7fe8136ed9395'
AND (
token = 'F7fyLm2rUOwXyi+2AR5l/6BT120sU47QOc1pfQNDvI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)