UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/umA+UhVJ3DrduG9+lb34vWoO7gmyJy5wuFSH641uj8=' 
WHERE 
  key_id = '20fc00983242cc34dadadfc178a5faa35fee8642488f8a9fec64804d76df6c1f' 
  AND (
    token = '/umA+UhVJ3DrduG9+lb34vWoO7gmyJy5wuFSH641uj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039